<!DOCTYPE html>
<html lang="en">
<head>
    <title>ChatGPT Test</title>
    <script>
        function askGPT() {
            const question = document.getElementById("question").value;
            fetch("/api/chat/ask", {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify(question)
            })
                .then(response => response.text())
                .then(data => {
                    document.getElementById("response").innerText = data;
                });
        }
    </script>
</head>
<body>
<h1>Test ChatGPT Interaction</h1>
<label for="question"></label><textarea id="question" placeholder="Ask ChatGPT..."></textarea><br/>
<button onclick="askGPT()">Ask</button>
<hr>
<p>Response:</p>
<pre id="response"></pre>
</body>
</html>
